package cn.edu.lingnan.lsqn.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import cn.cdahua.basic.dao.BaseDao;
import cn.edu.lingnan.lsqn.model.Role;

@Repository("roleDao")
public class RoleDao extends BaseDao<Role> implements IRoleDao {

	@Override
	public List<Role> list() {
		String hql = "from Role";
		return list(hql);
	}

	@Override
	public void deleteRoleUsers(int rid) {
		String hql = "delete UserRole ur where ur.role.id = ?";
		updateByHql(hql, rid);
	}

}
